<%-- 
    Document   : MedicinesToIssue
    Created on : Apr 3, 2012, 11:54:13 PM
    Author     : Anil
--%>
<%@page import="java.util.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="errorpage.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>medicinissued</title>
        <link href="PHScss.css" rel="stylesheet" type="text/css" />
    </head>
    <%
        int patientId=Integer.parseInt(request.getParameter("patientId"));
    %>
    <body>
        <table align="top" border="0" width="100%">
          <tbody>
              <tr>
                  <td align="left"><font size="5" color="red">Welcome: <%= session.getAttribute("Username")%></font></td>
                  <td align="right"><font size="3" color="red"><a href="logout.jsp" target="_top">Logout</a></font></td>
              </tr>
          </tbody>
        </table>
        <jsp:useBean id="medicineList" class="PHS.MedicinePrescribe" scope="page">
            <jsp:setProperty name="medicineList" property="patientId" value="<%=patientId%>"/>
            <% medicineList.getMedicinePrescribed();
                ArrayList nameList=new ArrayList();
               nameList=medicineList.getnameList();
               ArrayList doseList=new ArrayList();
               doseList=medicineList.getDoseList();
               ArrayList usageList=new ArrayList();
               usageList=medicineList.getUsageList();
               ArrayList typeList=new ArrayList();
               typeList=medicineList.getTypeList();
               ArrayList qntityList =new ArrayList();
               qntityList=medicineList.getQuantityList();
               Iterator nameIter=nameList.iterator();
               Iterator doseIter=doseList.iterator();
               Iterator usageIter=usageList.iterator();
               Iterator typeIter=typeList.iterator();
               Iterator qntityIter=qntityList.iterator();

            %>
            <form method="GET" action="">

            <table align="center" border="1">

                <thead>
                    <tr>
                        <th>Medicine Name</th>
                        <th>Dose</th>
                        <th>Usage</th>
                        <th>Type</th>
                        <th>Prescribed Quantity</th>
                        <th>Isuued Quantity</th>
                        <th>Status</th>
                        <th>cost</th>
                    </tr>
                </thead>
                <% while(nameIter.hasNext()){%>
                <tr>
                    <td><%= nameIter.next()%></td>
                    <td><%= doseIter.next()%></td>
                    <td><%= usageIter.next()%></td>
                    <td><%= typeIter.next()%></td>
                    <td><%= qntityIter.next()%></td>
                    <td><input type="text" name="" value="" size="8" /></td>
                    <td><input type="text" name="" value="" size="10" /></td>
                    <td><input type="text" name="" value="" size="10" /></td>
                </tr>
                <% } %>
            </table>
            <table align="center">
                <tr>
                    <td></td>
                    <td></td>
                    <td><input type="submit" value="add" name="add" /></td>
                    <td></td>
                    <td><input type="reset" value="clear" name="clear" /></td>
                </tr>
            </table>

            </form>
        </jsp:useBean>
    </body>
</html>
